# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=rtw89-src
_modname=rtw89
pkgver=7_p20230725
_gitrev=3891b68c09df5e023b78c20712c40b85be0436f2
pkgrel=0
pkgdesc="Driver for Realtek 8852AE, an 802.11ax device for Linux <6.5 (sources)"
url="https://github.com/lwfinger/rtw89"
arch="noarch"
license="GPL-2.0-or-later"
source="https://github.com/lwfinger/rtw89/archive/$_gitrev/$_modname-$_gitrev.tar.gz"
builddir="$srcdir/rtw89-$_gitrev"
options="!check"  # just sources

prepare() {
	default_prepare

	cat >AKMBUILD <<-EOF
	modname=$_modname
	modver=$pkgver-r$pkgrel
	built_modules='rtw89core.ko rtw89pci.ko'
	EOF
}

package() {
	install -D -m644 -t "$pkgdir"/usr/src/$_modname-$pkgver \
		./*.c ./*.h Makefile AKMBUILD
}

sha512sums="
99ec9a99552915a7530714627e10c40f36fd7a431c2506a87cf008484aa220d4f829ea696193fdf5071d8f9fb0c5f8cf17e04e756ba2ebe5a3e1ac151bd62be1  rtw89-3891b68c09df5e023b78c20712c40b85be0436f2.tar.gz
"
